package com.nuit.cxl.bilibili;

import com.nuit.cxl.bilibili.dao.RecommendDao;
import com.nuit.cxl.bilibili.service.RecommendService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;

//@SpringBootApplication
public class AnnotationApplication {
    public static void main(String[] args) {

//        SpringApplication.run(AnnotationApplication.class, args);

        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        RecommendDao recommendDao = (RecommendDao) ctx.getBean(RecommendDao.class);
//        recommendDao.getDataFromDatabase();
        RecommendService recommendService = (RecommendService) ctx.getBean(RecommendService.class);
        recommendService.fetchRecommend();
    }

}
